<?php
class Test_TestController extends Ctrl_Base{
    public function indexAction(){
        $TAMO = new AdminModel;
        $w_id = Tool_Fnc::safe_string('50');
        $name = Tool_Fnc::safe_string('1001011');
        $pPrivateKey = Tool_Fnc::newrand();
        $password = Tool_Fnc::markmd5('123123',$pPrivateKey);
        $role = Tool_Fnc::safe_string('2');
        $department = Tool_Fnc::safe_string(rtrim(implode(',','2,3,4'),','));
        $create = time();
     //   echo $create;
        
        $data = array(
             'w_id' => $w_id,
             'name' => $name,
             'password' => $password,
             'private_key' => $pPrivateKey,
             'role' => $role,
             'department' => $department,
             'status' => 1,
             'created' => $time,
         );
      // if($TAMO->insert($data)){
       // echo "添加成功<br>";
      // };
        $wid = Tool_Fnc::safe_string('20');
        $pid = Tool_Fnc::safe_string('39'); 
        $tsql = 'select * from '.$TAMO->table.' where id='.$pid;
        $arr = $TAMO->query($tsql);
        print_r($arr);
        echo "<br>";
        $UPsql = 'update '.$TAMO->table.' set w_id='.$wid.' where id='.$pid;
        print_r($UPsql);
        $TAMO->query($UPsql);
        echo "<br>";
        $DEsql = 'delete from '.$TAMO->table.' where id='.$pid;
        print_r($DEsql);
        echo "<br>";
     $TAMO->query($DEsql);die;
     
    }
}
?>
